home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / biblio / bibtex / contrib / econometrica.bst < prev    next >
Text File  |  1994-08-25  |  27KB  |  1,293 lines

  1. %%% Econometrica bibliography style
  2. %%% For use with harvard.sty and LaTeX2e (NFSS) or LaTeX 2.09
  3. %%% 24-aug-94
  4. %%%
  5. %%% Based on makebst, but with modifications by
  6. %%% kcb@hss.caltech.edu (KC Border)
  7. %%% Please report any problems to me.
  8. %%%
  9. %%% The main changes from the ouput of makebst are:
  10. %%% 1. Addition of a function to replace repeated authors with a 3 em dash.
  11. %%%     (Search for compare.names, this function is portable.)
  12. %%% 2. Modification of output.nonnull to allow commas inside quotation marks
  13. %%%        and no comma after year.
  14. %%% 3.Eliminated feature (bug?) of the harvard style of citation.
  15. %%%        It creates a short label for subsequent citations.  This alleged
  16. %%%        feature shortens both Aliprantis, Border, and Luxemburg (1991) and
  17. %%%        Aliprantis, Brown, and Burkinshaw (1991) to Aliprantis et~al. (1991).
  18. %%%        This creates the need to label these as
  19. %%%        Aliprantis, Border, and Luxemburg (1991a) and
  20. %%%        Aliprantis, Brown, and Burkinshaw (1991b), despite the fact
  21. %%%        that these entries have different authors.  I used my own format
  22. %%%        for creating the labels, and used the same label for
  23. %%%        both the short and long forms.  I know that the
  24. %%%        _Chicago_Manual_of_Style recommends using Aliprantis et~al,
  25. %%        but Econometrica regularly writes out three authors,
  26. %%        and it is rare to cite an article with more than four authors in
  27. %%%        Econometrica. (I couldn't find an example of even four being cited,
  28. %%%        but I didn't spend a lot of time looking.)
  29. %%% 4. Addition of macros to handle editions. (My own idiosycracy.)
  30. %%% 5. A new entry type called issue for special issues of a journal.
  31. %%%        (Another idiosyncracy.)
  32. %%% 6. Many details to conform to Econometrica's quirks.
  33. %%%     (Search for KCB )
  34. %%%    7. I wrote this for use with LaTeX2e and the NFSS2.  However, I did
  35. %%%        add some macros so it will work with LaTeX 2.09.
  36. %%%        (Search for \ifx\undefined\emph )
  37. %%% The remainder of this file was generated by makebst, except for
  38. %%% modifications marked with KCB.
  39. %%
  40. %% This is file `em.bst', generated
  41. %% on <1994/8/17> with the docstrip utility (2.2h).
  42. %%
  43. %% The original source files were:
  44. %%
  45. %% genbst.mbs  (with options: `ay,har,nm-rev1,nmft-sc,dt-beg,yr-par,tit-qq,atit-u,thtit-a,volp-com,edby,blk-com,pp,ed,abr,and-com,nfss')
  46. %% ----------------------------------------
  47. %% *** Econometrica style ***
  48. %%
  49. %% (Here are the specifications of the source file)
  50. %% \def\filename{genbst.mbs}
  51. %% \def\filedate{1994 July 1}
  52. %% \def\fileversion{1.3}
  53. %%   For use with BibTeX version 0.99a or later, LaTeX version 2.09
  54. %%-------------------------------------------------------------------
  55. %% NOTICE:
  56. %% This file may be used for non-profit purposes.
  57. %% It may not be distributed in exchange for money,
  58. %%   other than distribution costs.
  59. %%
  60. %% The author provides it `as is' and does not guarantee it in any way.
  61. %%
  62. %% Copyright (C) 1994 Patrick W. Daly
  63. %% Max-Planck-Institut f\"ur Aeronomie
  64. %% Postfach 20
  65. %% D-37189 Katlenburg-Lindau
  66. %% Germany
  67. %%
  68. %% E-mail:
  69. %% SPAN--     nsp::linmpi::daly    (note nsp also known as ecd1)
  70. %% Internet-- daly@linmpi.dnet.gwdg.de
  71. %%-----------------------------------------------------------
  72. %% \CharacterTable
  73. %%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
  74. %%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
  75. %%   Digits        \0\1\2\3\4\5\6\7\8\9
  76. %%   Exclamation   \!     Double quote  \"     Hash (number) \#
  77. %%   Dollar        \$     Percent       \%     Ampersand     \&
  78. %%   Acute accent  \'     Left paren    \(     Right paren   \)
  79. %%   Asterisk      \*     Plus          \+     Comma         \,
  80. %%   Minus         \-     Point         \.     Solidus       \/
  81. %%   Colon         \:     Semicolon     \;     Less than     \<
  82. %%   Equals        \=     Greater than  \>     Question mark \?
  83. %%   Commercial at \@     Left bracket  \[     Backslash     \\
  84. %%   Right bracket \]     Circumflex    \^     Underscore    \_
  85. %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
  86. %%   Right brace   \}     Tilde         \~}
  87. %%---------------------------------------------------------------------
  88.  % This is an author-year citation style bibliography. As such, it is
  89.  % non-standard LaTeX, and requires a style option to function properly.
  90.  % The appropriate style file is:   harvard.sty
  91.  % The form of the bibitem entries is
  92.  %   \harvarditem[Jones et al.]{Jones, Baker, and Smith}{1990}{key}...
  93.  % There are style changes that may be specified in the text with
  94.  % the command \citationstyle.
  95.  %   \citeasnoun{key} ==>>    Jones et al. (1990)
  96.  %   \cite{key} ==>>          (Jones et al. 1990)
  97.  %   \cite[chap. 2]{key} ==>> (Jones et al. 1990, chap. 2)
  98.  % On the first citation of any work, the full author list is used.
  99. %%---------------------------------------------------------------------
  100.  
  101. ENTRY
  102.   { address
  103.     author
  104.     booktitle
  105.     chapter
  106.     edition
  107.     editor
  108.     howpublished
  109.     institution
  110.     journal
  111.     key
  112.     month
  113.     note
  114.     number
  115.     organization
  116.     pages
  117.     publisher
  118.     school
  119.     series
  120.     title
  121.     type
  122.     volume
  123.     year
  124.   }
  125.   {}
  126.   { label extra.label sort.label }    %%%KCB: removed  long.label
  127.  
  128. INTEGERS { output.state before.all mid.sentence after.sentence after.block }
  129.  
  130. %%%KCB: new output state, no.comma
  131. INTEGERS { no.comma}
  132.  
  133. FUNCTION {init.state.consts}
  134. { #0 'before.all :=
  135.   #1 'mid.sentence :=
  136.   #2 'after.sentence :=
  137.   #3 'after.block :=
  138.   #4 'no.comma :=    %%%KCB
  139. }
  140.  
  141. STRINGS { s t }
  142.  
  143.  
  144. %%%KCB: revise to use new output state
  145. FUNCTION {output.nonnull}
  146. { 's :=
  147.  output.state no.comma = %%%KCB: if in this state, write a space
  148.  {  " " * write$ before.all 'output.state := }    %%%KCB
  149.  {  output.state mid.sentence =        %%%KCB: add brace at beginning
  150.     { ", " * write$ }
  151.     { output.state after.block =
  152.         { add.period$ write$
  153.           newline$
  154.           "\newblock " write$
  155.         }
  156.         { output.state before.all =
  157.             'write$
  158.             { add.period$ " " * write$ }
  159.           if$
  160.         }
  161.       if$
  162.   }
  163.  if$
  164.  mid.sentence 'output.state :=
  165.  }    %%%KCB: matching brace
  166.  if$    %%%KCB: test for no.comma state
  167.   s
  168. }
  169.  
  170. FUNCTION {output}
  171. { duplicate$ empty$
  172.     'pop$
  173.     'output.nonnull
  174.   if$
  175. }
  176.  
  177. FUNCTION {output.check}
  178. { 't :=
  179.   duplicate$ empty$
  180.     { pop$ "empty " t * " in " * cite$ * warning$ }
  181.     'output.nonnull
  182.   if$
  183. }
  184.  
  185. FUNCTION {output.bibitem}
  186. { newline$
  187.   "\harvarditem[" write$
  188.   label write$
  189.   "]{" label * "}{" * write$    %%%KCB: replaced long.label with label
  190.   year duplicate$ empty$
  191.     { pop$ "????" }
  192.     'skip$
  193.   if$
  194.   extra.label * "}{" * write$
  195.   cite$ write$
  196.   "}" write$
  197.   newline$
  198.   ""
  199.   before.all 'output.state :=
  200. }
  201.  
  202. FUNCTION {fin.entry}
  203. { add.period$
  204.   write$
  205.   newline$
  206. }
  207.  
  208. FUNCTION {new.block}
  209. { output.state before.all =
  210.     'skip$
  211.     { after.block 'output.state := }
  212.   if$
  213. }
  214.  
  215. FUNCTION {new.sentence}
  216. { output.state after.block =
  217.     'skip$
  218.     { output.state before.all =
  219.         'skip$
  220.         { after.sentence 'output.state := }
  221.       if$
  222.     }
  223.   if$
  224. }
  225.  
  226. FUNCTION {not}
  227. {   { #0 }
  228.     { #1 }
  229.   if$
  230. }
  231.  
  232. FUNCTION {and}
  233. {   'skip$
  234.     { pop$ #0 }
  235.   if$
  236. }
  237.  
  238. FUNCTION {or}
  239. {   { pop$ #1 }
  240.     'skip$
  241.   if$
  242. }
  243.  
  244. FUNCTION {new.block.checkb}
  245. { empty$
  246.   swap$ empty$
  247.   and
  248.     'skip$
  249.     'new.block
  250.   if$
  251. }
  252.  
  253. FUNCTION {field.or.null}
  254. { duplicate$ empty$
  255.     { pop$ "" }
  256.     'skip$
  257.   if$
  258. }
  259.  
  260. FUNCTION {emphasize}
  261. { duplicate$ empty$
  262.     { pop$ "" }
  263.     { "\emph{" swap$ * "}" * }
  264.   if$
  265. }
  266.  
  267. INTEGERS { nameptr namesleft numnames }
  268.  
  269. %%%KCB:  Here is a portable set of routines to check for repeated authors
  270. %%% and replace them with a 3 em dash
  271. %%% According to _Chicago_Manual_of_Style_, a dash is used to
  272. %%% replace an author's name only if the entire list is the same, so:
  273. %%% Compare names. See if prev.name is identical to CurrList.
  274. %%% If not, then just output CurrList.
  275. %%% If so, replace with \BySame
  276. %%% I use a conservative matching scheme,
  277. %%% and check to see if full names are identical,
  278. %%% even though we only use initials.
  279. %%% This may mean that you have to correct your .bib database
  280. %%% to ensure consistency.
  281. %%%
  282. %%% sample usage:
  283. %%% search for {format.author}
  284.  
  285. INTEGERS {currNum prevNum}
  286.  
  287. STRINGS {PrevList CurrList prev.name PrevTemp CurrTemp}
  288.  
  289. %%%KCB: Initialize prev.name ot some nonsense string:
  290.  
  291. FUNCTION {init.prev.name}
  292. {
  293. "My puppy Harley" 'prev.name :=
  294. }
  295.  
  296. %%%KCB: Must EXECUTE {init.prev.name} after READ
  297.  
  298. %%%KCB: <CurrList> compare.names <modified name list>
  299. FUNCTION {compare.names}
  300. {    prev.name 'PrevList :=
  301.     duplicate$ 'prev.name :=    % make current list the new previous list
  302.     'CurrList :=
  303.     PrevList num.names$ 'prevNum :=
  304.     CurrList num.names$ 'currNum :=
  305. %
  306.    prevNum currNum =    %% If prevNum = currNum
  307.   {    "" 'PrevTemp :=        %% Then take this branch
  308.     "" 'CurrTemp :=
  309.     #1 'nameptr :=    %%% start with first name in each list
  310.     { nameptr prevNum > not }%% while nameptr <= prevNum
  311. %% Format both lists the same way.
  312. %% Use full names: bib file might need to be corrected
  313.     {
  314.     PrevList nameptr "{ff }{vv~}{ll}{ jj}" format.name$ PrevTemp * 'PrevTemp :=
  315.     CurrList nameptr "{ff }{vv~}{ll}{ jj}" format.name$ CurrTemp * 'CurrTemp :=
  316.     nameptr #1 + 'nameptr := }
  317.     while$
  318. %% Now compare :
  319.     PrevTemp CurrTemp =    %% If PrevTemp = CurrTemp
  320.     { "\BySame{}" }
  321.     { CurrList }
  322.     if$
  323.     }
  324.     { CurrList }    %% If not prevNum = currNum
  325.   if$            %% If prevNum = currNum
  326. }
  327.  
  328. %%%
  329. %%%
  330. %%%KCB:  End of new routine.
  331.  
  332.  
  333. FUNCTION {format.names}
  334. { 's :=
  335.   #1 'nameptr :=
  336.   s num.names$ 'numnames :=
  337.   numnames 'namesleft :=
  338.     { namesleft #0 > }
  339.     { nameptr #1 >
  340.         { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't := }
  341.         { s nameptr "{vv~}{ll}{, jj}{, f.}" format.name$ 't := }
  342.       if$
  343.       nameptr #1 >
  344.         {
  345.           namesleft #1 >
  346.             { ", " * t * }
  347.             {
  348.               ", " *
  349.               t "others" =
  350.                 { " et~al." * }
  351.                 { " {\small and} " * t * }    %%%KCB: added \small
  352.               if$
  353.             }
  354.           if$
  355.         }
  356.         't
  357.       if$
  358.       nameptr #1 + 'nameptr :=
  359.       namesleft #1 - 'namesleft :=
  360.     }
  361.   while$
  362. }
  363.  
  364.  
  365. FUNCTION {format.names.ed}
  366. { 's :=
  367.   #1 'nameptr :=
  368.   s num.names$ 'numnames :=
  369.   numnames 'namesleft :=
  370.     { namesleft #0 > }
  371.     { s nameptr
  372.       "{f.~}{vv~}{ll}{, jj}"
  373.       format.name$ 't :=
  374.       nameptr #1 >
  375.         {
  376.           namesleft #1 >
  377.             { ", " * t * }
  378.             {
  379.               ", " *
  380.               t "others" =
  381.                 { " et~al." * }
  382.                 { " {\small and} " * t * }    %%%KCB: added \small
  383.               if$
  384.             }
  385.           if$
  386.         }
  387.         't
  388.       if$
  389.       nameptr #1 + 'nameptr :=
  390.       namesleft #1 - 'namesleft :=
  391.     }
  392.   while$
  393. }
  394.  
  395. FUNCTION {format.key}
  396. { empty$
  397.     { key field.or.null }
  398.     { "" }
  399.   if$
  400. }
  401.  
  402. FUNCTION {format.authors}
  403. { author empty$
  404.     { "" }
  405.     { "\textsc{" author compare.names format.names * "} " * }
  406.   if$
  407. }
  408.  
  409. FUNCTION {format.editors}
  410. { editor empty$
  411.     { "" }
  412.     { "\textsc{" editor compare.names format.names * " }" *
  413.       editor num.names$ #1 >
  414.         { " (eds.)" * }
  415.         { " (ed.)" * }
  416.       if$
  417.     }
  418.   if$
  419. }
  420.  
  421. FUNCTION {format.in.editors}
  422. { editor empty$
  423.     { "" }
  424.     { editor format.names.ed
  425.     }
  426.   if$
  427. }
  428.  
  429. FUNCTION {format.title}
  430. { title empty$
  431.     { "" }
  432.     { title
  433.       "``" swap$ * ",'' " *
  434.     }
  435. no.comma 'output.state :=   %%%KCB:
  436.   if$
  437. }
  438.  
  439. FUNCTION {n.dashify}
  440. { 't :=
  441.   ""
  442.     { t empty$ not }
  443.     { t #1 #1 substring$ "-" =
  444.         { t #1 #2 substring$ "--" = not
  445.             { "--" *
  446.               t #2 global.max$ substring$ 't :=
  447.             }
  448.             {   { t #1 #1 substring$ "-" = }
  449.                 { "-" *
  450.                   t #2 global.max$ substring$ 't :=
  451.                 }
  452.               while$
  453.             }
  454.           if$
  455.         }
  456.         { t #1 #1 substring$ *
  457.           t #2 global.max$ substring$ 't :=
  458.         }
  459.       if$
  460.     }
  461.   while$
  462. }
  463.  
  464. FUNCTION {word.in}
  465. { "in " }
  466.  
  467. FUNCTION {format.date}
  468. { year duplicate$ empty$
  469.     { "empty year in " cite$ * "; set to ????" * warning$
  470.        pop$ "????" }
  471.     'skip$
  472.   if$
  473.   " (" swap$ * extra.label * "):" *    %%%KCB: added :
  474.    before.all 'output.state :=        %%%KCB:
  475. }
  476.  
  477. FUNCTION {format.btitle}
  478. { title emphasize
  479. no.comma 'output.state :=        %%%KCB:
  480. }
  481.  
  482. FUNCTION {tie.or.space.connect}
  483. { duplicate$ text.length$ #3 <
  484.     { "~" }
  485.     { " " }
  486.   if$
  487.   swap$ * *
  488. }
  489.  
  490. FUNCTION {either.or.check}
  491. { empty$
  492.     'pop$
  493.     { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  494.   if$
  495. }
  496.  
  497. FUNCTION {format.bvolume}
  498. { volume empty$
  499.     { "" }
  500.     { "vol." volume tie.or.space.connect
  501.       series empty$
  502.         'skip$
  503.         { " of " * series emphasize * }
  504.       if$
  505.       "volume and number" number either.or.check
  506.     }
  507.   if$
  508. }
  509.  
  510. FUNCTION {format.number.series}
  511. { volume empty$
  512.     { number empty$
  513.         { series field.or.null }
  514.         { output.state mid.sentence =
  515.             { "no." }
  516.             { "No." }
  517.           if$
  518.           number tie.or.space.connect
  519.           series empty$
  520.             { "there's a number but no series in " cite$ * warning$ }
  521.             { " in " * series * }
  522.           if$
  523.         }
  524.       if$
  525.     }
  526.     { "" }
  527.   if$
  528. }
  529.  
  530. FUNCTION {format.edition}
  531. { edition empty$
  532.     { "" }
  533.     { output.state mid.sentence =
  534.         { edition "l" change.case$ " edn." * }
  535.         { edition "t" change.case$ " edn." * }
  536.       if$
  537.     }
  538.   if$
  539. }
  540.  
  541. INTEGERS { multiresult }
  542.  
  543. FUNCTION {multi.page.check}
  544. { 't :=
  545.   #0 'multiresult :=
  546.     { multiresult not
  547.       t empty$ not
  548.       and
  549.     }
  550.     { t #1 #1 substring$
  551.       duplicate$ "-" =
  552.       swap$ duplicate$ "," =
  553.       swap$ "+" =
  554.       or or
  555.         { #1 'multiresult := }
  556.         { t #2 global.max$ substring$ 't := }
  557.       if$
  558.     }
  559.   while$
  560.   multiresult
  561. }
  562.  
  563. FUNCTION {format.pages}
  564. { pages empty$
  565.     { "" }
  566.     { pages multi.page.check
  567.         { "pp." pages n.dashify tie.or.space.connect }
  568.         { "p." pages tie.or.space.connect }
  569.       if$
  570.     }
  571.   if$
  572. }
  573.  
  574. FUNCTION {format.vol.num.pages}
  575. { volume field.or.null
  576.   number empty$
  577.     'skip$
  578.     { "(" number * ")" * *
  579.       volume empty$
  580.         { "there's a number but no volume in " cite$ * warning$ }
  581.         'skip$
  582.       if$
  583.     }
  584.   if$
  585.   pages empty$
  586.     'skip$
  587.     { duplicate$ empty$
  588.         { pop$ format.pages }
  589.         { ", " * pages n.dashify * }
  590.       if$
  591.     }
  592.   if$
  593. }
  594.  
  595. FUNCTION {format.chapter.pages}
  596. { chapter empty$
  597.     'format.pages
  598.     { type empty$
  599.         { "chap." }
  600.         { type "l" change.case$ }
  601.       if$
  602.       chapter tie.or.space.connect
  603.       pages empty$
  604.         'skip$
  605.         { ", " * format.pages * }
  606.       if$
  607.     }
  608.   if$
  609. }
  610.  
  611. FUNCTION {format.in.ed.booktitle}
  612. { booktitle empty$
  613.     { "" }
  614.     { editor empty$
  615.         { word.in booktitle emphasize * }
  616.         { word.in booktitle emphasize * ", ed. by " *    %%%KCB: abbrv ed.
  617.           format.in.editors * }
  618.       if$
  619.     }
  620.   if$
  621. }
  622.  
  623. FUNCTION {format.thesis.type}
  624. { type empty$
  625.     'skip$
  626.     { pop$
  627.       type "t" change.case$
  628.     }
  629.   if$
  630. }
  631.  
  632. FUNCTION {format.tr.number}
  633. { type empty$
  634.     { "Discussion Paper" }    %%%KCB: changed default
  635.     'type
  636.   if$
  637.   number empty$
  638.     { "t" change.case$ }
  639.     { number tie.or.space.connect }
  640.   if$
  641. }
  642.  
  643. FUNCTION {format.article.crossref}
  644. {
  645.   word.in
  646.   "\cite{" * crossref * "}" *
  647. }
  648.  
  649. FUNCTION {format.book.crossref}
  650. { volume empty$
  651.     { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  652.       word.in
  653.     }
  654.     { "vol." volume tie.or.space.connect
  655.       " of " *
  656.     }
  657.   if$
  658.   "\cite{" * crossref * "}" *
  659. }
  660.  
  661. FUNCTION {format.incoll.inproc.crossref}
  662. {
  663.   word.in
  664.   "\cite{" * crossref * "}" *
  665. }
  666.  
  667. FUNCTION {article}
  668. { output.bibitem
  669.   format.authors "author" output.check
  670.   author format.key output
  671.   format.date "year" output.check
  672.   format.title "title" output.check
  673.  crossref missing$
  674.     { journal emphasize "journal" output.check
  675.       format.vol.num.pages output
  676.     }
  677.     { format.article.crossref output.nonnull
  678.       format.pages output
  679.     }
  680.   if$
  681.   note output
  682.   fin.entry
  683. }
  684.  
  685. FUNCTION {book}
  686. { output.bibitem
  687.   author empty$
  688.     { format.editors "author and editor" output.check
  689.       editor format.key output
  690.     }
  691.     { format.authors output.nonnull
  692.       crossref missing$
  693.         { "author and editor" editor either.or.check }
  694.         'skip$
  695.       if$
  696.     }
  697.   if$
  698.   format.date "year" output.check
  699.   format.btitle "title" output.check
  700.     mid.sentence 'output.state :=    %%%KCB:
  701.   crossref missing$
  702.     { format.bvolume output
  703.       format.number.series output
  704.       new.sentence
  705.       publisher "publisher" output.check
  706.       address output
  707.     }
  708.     {
  709.       format.book.crossref output.nonnull
  710.     }
  711.   if$
  712.   format.edition output
  713.   note output
  714.   fin.entry
  715. }
  716.  
  717. FUNCTION {booklet}
  718. { output.bibitem
  719.   format.authors output
  720.   author format.key output
  721.   format.date "year" output.check
  722.   format.title "title" output.check
  723.   howpublished output
  724.   address output
  725.   note output
  726.   fin.entry
  727. }
  728.  
  729. FUNCTION {inbook}
  730. { output.bibitem
  731.   author empty$
  732.     { format.editors "author and editor" output.check
  733.       editor format.key output
  734.     }
  735.     { format.authors output.nonnull
  736.       crossref missing$
  737.         { "author and editor" editor either.or.check }
  738.         'skip$
  739.       if$
  740.     }
  741.   if$
  742.   format.date "year" output.check
  743.   format.btitle "title" output.check
  744.   crossref missing$
  745.     { format.bvolume output
  746.       format.chapter.pages "chapter and pages" output.check
  747.       format.number.series output
  748.       new.sentence
  749.       publisher "publisher" output.check
  750.       address output
  751.     }
  752.     { format.chapter.pages "chapter and pages" output.check
  753.       format.book.crossref output.nonnull
  754.     }
  755.   if$
  756.   format.edition output
  757.   note output
  758.   fin.entry
  759. }
  760.  
  761. FUNCTION {incollection}
  762. { output.bibitem
  763.   format.authors "author" output.check
  764.   author format.key output
  765.   format.date "year" output.check
  766.   format.title "title" output.check
  767.   crossref missing$
  768.     { format.in.ed.booktitle "booktitle" output.check
  769.       format.bvolume output
  770.       format.number.series output
  771.       format.chapter.pages output
  772.       new.sentence
  773.       publisher "publisher" output.check
  774.       address output
  775.       format.edition output
  776.     }
  777.     { format.incoll.inproc.crossref output.nonnull
  778.       format.chapter.pages output
  779.     }
  780.   if$
  781.   note output
  782.   fin.entry
  783. }
  784.  
  785. FUNCTION {inproceedings}
  786. { output.bibitem
  787.   format.authors "author" output.check
  788.   author format.key output
  789.   format.date "year" output.check
  790.   format.title "title" output.check
  791.   crossref missing$
  792.     { format.in.ed.booktitle "booktitle" output.check
  793.       format.bvolume output
  794.       format.number.series output
  795.       format.pages output
  796.       address output
  797.       new.sentence
  798.       organization output
  799.       publisher output
  800.     }
  801.     { format.incoll.inproc.crossref output.nonnull
  802.       format.pages output
  803.     }
  804.   if$
  805.   note output
  806.   fin.entry
  807. }
  808.  
  809. FUNCTION {conference} { inproceedings }
  810.  
  811. %%%KCB: special issue of a journal with a special editor
  812.  
  813. FUNCTION {issue}
  814. { output.bibitem
  815.   format.editors output
  816.   editor format.key output
  817.   format.date "year" output.check
  818.   format.btitle "title" output.check
  819.   crossref missing$
  820.     { journal emphasize "journal" output.check
  821.       format.vol.num.pages output
  822.     }
  823.     { format.article.crossref output.nonnull
  824.       format.pages output
  825.     }
  826.   if$
  827.   note output
  828.   fin.entry
  829. }
  830.  
  831. FUNCTION {manual}
  832. { output.bibitem
  833.   format.authors output
  834.   author format.key output
  835.   format.date "year" output.check
  836.   format.btitle "title" output.check
  837.   organization output
  838.   address output
  839.   format.edition output
  840.   note output
  841.   fin.entry
  842. }
  843.  
  844. FUNCTION {mastersthesis}
  845. { output.bibitem
  846.   format.authors "author" output.check
  847.   author format.key output
  848.   format.date "year" output.check
  849.   format.title "title" output.check
  850.   "Master's thesis" format.thesis.type output.nonnull
  851.   school "school" output.check
  852.   address output
  853.   note output
  854.   fin.entry
  855. }
  856.  
  857. FUNCTION {misc}
  858. { output.bibitem
  859.   format.authors output
  860.   author format.key output
  861.   format.date "year" output.check
  862.   format.title output
  863.   howpublished output
  864.   note output
  865.   fin.entry
  866. }
  867.  
  868. FUNCTION {phdthesis}
  869. { output.bibitem
  870.   format.authors "author" output.check
  871.   author format.key output
  872.   format.date "year" output.check
  873.   format.title "title" output.check
  874.   "Ph.D. thesis" format.thesis.type output.nonnull
  875.   school "school" output.check
  876.   address output
  877.   note output
  878.   fin.entry
  879. }
  880.  
  881. FUNCTION {proceedings}
  882. { output.bibitem
  883.   format.editors output
  884.   editor format.key output
  885.   format.date "year" output.check
  886.   format.btitle "title" output.check
  887.   format.bvolume output
  888.   format.number.series output
  889.   address output
  890.   new.sentence
  891.   organization output
  892.   publisher output
  893.   note output
  894.   fin.entry
  895. }
  896.  
  897. FUNCTION {techreport}
  898. { output.bibitem
  899.   format.authors "author" output.check
  900.   author format.key output
  901.   format.date "year" output.check
  902.   format.title "title" output.check
  903.   format.tr.number output.nonnull
  904.   institution "institution" output.check
  905.   address output
  906.   note output
  907.   fin.entry
  908. }
  909.  
  910. FUNCTION {unpublished}
  911. { output.bibitem
  912.   format.authors "author" output.check
  913.   author format.key output
  914.   format.date "year" output.check
  915.   format.title "title" output.check
  916.   note "note" output.check
  917.   fin.entry
  918. }
  919.  
  920. FUNCTION {default.type} { misc }
  921.  
  922. MACRO {jan} {"January"}
  923.  
  924. MACRO {feb} {"February"}
  925.  
  926. MACRO {mar} {"March"}
  927.  
  928. MACRO {apr} {"April"}
  929.  
  930. MACRO {may} {"May"}
  931.  
  932. MACRO {jun} {"June"}
  933.  
  934. MACRO {jul} {"July"}
  935.  
  936. MACRO {aug} {"August"}
  937.  
  938. MACRO {sep} {"September"}
  939.  
  940. MACRO {oct} {"October"}
  941.  
  942. MACRO {nov} {"November"}
  943.  
  944. MACRO {dec} {"December"}
  945.  
  946. %%%KCB: removed computer science journal macros
  947. %%%KCB: added following macros for editions
  948. MACRO {first} {"1st "}
  949. MACRO {second} {"2d "}
  950. MACRO {third} {"3d "}
  951. MACRO {fourth} {"4th "}
  952. MACRO {fifth} {"5th "}
  953. MACRO {sixth} {"6th"}
  954. MACRO {seventh} {"7th "}
  955. MACRO {eighth} {"8th "}
  956. MACRO {ninth} {"9th "}
  957. MACRO {tenth} {"10th "}
  958.  
  959. READ
  960.  
  961. FUNCTION {sortify}
  962. { purify$
  963.   "l" change.case$
  964. }
  965.  
  966. INTEGERS { len }
  967.  
  968. FUNCTION {chop.word}
  969. { 's :=
  970.   'len :=
  971.   s #1 len substring$ =
  972.     { s len #1 + global.max$ substring$ }
  973.     's
  974.   if$
  975. }
  976.  
  977.  
  978. %%%KCB:  Change format of labels:
  979. FUNCTION {format.lab.names}
  980. { 's :=
  981.   #1 'nameptr :=
  982.   s num.names$ 'numnames :=
  983.   numnames 'namesleft :=
  984.     { namesleft #0 > }
  985.     { s nameptr "{vv~}{ll}" format.name$ 't :=
  986.       nameptr #1 >
  987.     { namesleft #1 >
  988.         { ", " * t * }
  989.         { numnames #2 >
  990.         { "," * }
  991.         'skip$
  992.           if$
  993.           t "others" =
  994.         { " et~al." * }
  995.         { " and " * t * }
  996.           if$
  997.         }
  998.       if$
  999.     }
  1000.     't
  1001.       if$
  1002.       nameptr #1 + 'nameptr :=
  1003.       namesleft #1 - 'namesleft :=
  1004.     }
  1005.   while$
  1006. }
  1007.  
  1008. %%%KCB: removed FUNCTION {format.long.lab.names}
  1009.  
  1010. FUNCTION {author.key.label}
  1011. { author empty$
  1012.     { key empty$
  1013.         { cite$ #1 #3 substring$ }
  1014.         'key
  1015.       if$
  1016.     }
  1017.     { author format.lab.names }
  1018.   if$
  1019. }
  1020.  
  1021. FUNCTION {author.editor.key.label}
  1022. { author empty$
  1023.     { editor empty$
  1024.         { key empty$
  1025.             { cite$ #1 #3 substring$ }
  1026.             'key
  1027.           if$
  1028.         }
  1029.         { editor format.lab.names }
  1030.       if$
  1031.     }
  1032.     { author format.lab.names }
  1033.   if$
  1034. }
  1035.  
  1036. FUNCTION {editor.key.label}
  1037. { editor empty$
  1038.     { key empty$
  1039.         { cite$ #1 #3 substring$ }
  1040.         'key
  1041.       if$
  1042.     }
  1043.     { editor format.lab.names }
  1044.   if$
  1045. }
  1046.  
  1047. %%%KCB: use entire year field as label
  1048.  
  1049. FUNCTION {calc.label}
  1050. { type$ "book" =
  1051.   type$ "inbook" =
  1052.   or
  1053.   type$ "issue" =    %%%KCB: need for new entry type
  1054.   or                %%%KCB
  1055.     'author.editor.key.label
  1056.     { type$ "proceedings" =
  1057.     'editor.key.label
  1058.     'author.key.label
  1059.       if$
  1060.     }
  1061.   if$
  1062.   ", "
  1063.   *
  1064.   year field.or.null
  1065.   *
  1066.   'label :=
  1067. }
  1068.  
  1069. FUNCTION {calc.short.label}
  1070. { type$ "book" =
  1071.   type$ "inbook" =
  1072.   or
  1073.     'author.editor.key.label
  1074.     { type$ "proceedings" =
  1075.         'editor.key.label
  1076.         'author.key.label
  1077.       if$
  1078.     }
  1079.   if$
  1080.   'label :=
  1081. }
  1082.  
  1083. %%%KCB: removed FUNCTION {calc.long.label}
  1084.  
  1085. FUNCTION {sort.format.names}
  1086. { 's :=
  1087.   #1 'nameptr :=
  1088.   ""
  1089.   s num.names$ 'numnames :=
  1090.   numnames 'namesleft :=
  1091.     { namesleft #0 > }
  1092.     { nameptr #1 >
  1093.         { "   " * }
  1094.         'skip$
  1095.       if$
  1096.       s nameptr
  1097.       "{vv{ } }{ll{ }}{  f{ }}{  jj{ }}"
  1098.       format.name$ 't :=
  1099.       nameptr numnames = t "others" = and
  1100.         { "et al" * }
  1101.         { t sortify * }
  1102.       if$
  1103.       nameptr #1 + 'nameptr :=
  1104.       namesleft #1 - 'namesleft :=
  1105.     }
  1106.   while$
  1107. }
  1108.  
  1109. FUNCTION {sort.format.title}
  1110. { 't :=
  1111.   "A " #2
  1112.     "An " #3
  1113.       "The " #4 t chop.word
  1114.     chop.word
  1115.   chop.word
  1116.   sortify
  1117.   #1 global.max$ substring$
  1118. }
  1119.  
  1120. FUNCTION {author.sort}
  1121. { author empty$
  1122.     { key empty$
  1123.         { "to sort, need author or key in " cite$ * warning$
  1124.           ""
  1125.         }
  1126.         { key sortify }
  1127.       if$
  1128.     }
  1129.     { author sort.format.names }
  1130.   if$
  1131. }
  1132.  
  1133. FUNCTION {author.editor.sort}
  1134. { author empty$
  1135.     { editor empty$
  1136.         { key empty$
  1137.             { "to sort, need author, editor, or key in " cite$ * warning$
  1138.               ""
  1139.             }
  1140.             { key sortify }
  1141.           if$
  1142.         }
  1143.         { editor sort.format.names }
  1144.       if$
  1145.     }
  1146.     { author sort.format.names }
  1147.   if$
  1148. }
  1149.  
  1150. FUNCTION {editor.sort}
  1151. { editor empty$
  1152.     { key empty$
  1153.         { "to sort, need editor or key in " cite$ * warning$
  1154.           ""
  1155.         }
  1156.         { key sortify }
  1157.       if$
  1158.     }
  1159.     { editor sort.format.names }
  1160.   if$
  1161. }
  1162.  
  1163. FUNCTION {presort}
  1164. { calc.label
  1165.   label sortify
  1166.   "    "
  1167.   *
  1168.   type$ "book" =
  1169.   type$ "inbook" =
  1170.   or
  1171.   type$ "issue" =    %%%KCB: need for new entry type
  1172.   or                %%%KCB
  1173.     'author.editor.sort
  1174.     { type$ "proceedings" =
  1175.         'editor.sort
  1176.         'author.sort
  1177.       if$
  1178.     }
  1179.   if$
  1180.   #1 entry.max$ substring$
  1181.   'sort.label :=
  1182.   sort.label
  1183.   *
  1184.   "    "
  1185.   *
  1186.   title field.or.null
  1187.   sort.format.title
  1188.   *
  1189.   #1 entry.max$ substring$
  1190.   'sort.key$ :=
  1191. }
  1192.  
  1193. ITERATE {presort}
  1194.  
  1195. SORT
  1196.  
  1197. STRINGS { last.label next.extra }
  1198.  
  1199. INTEGERS { last.extra.num }
  1200.  
  1201. FUNCTION {initialize.extra.label.stuff}
  1202. { #0 int.to.chr$ 'last.label :=
  1203.   "" 'next.extra :=
  1204.   #0 'last.extra.num :=
  1205. }
  1206.  
  1207. FUNCTION {forward.pass}
  1208. { last.label label =
  1209.     { last.extra.num #1 + 'last.extra.num :=
  1210.       last.extra.num int.to.chr$ 'extra.label :=
  1211.     }
  1212.     { "a" chr.to.int$ 'last.extra.num :=
  1213.       "" 'extra.label :=
  1214.       label 'last.label :=
  1215.     }
  1216.   if$
  1217. }
  1218.  
  1219. FUNCTION {reverse.pass}
  1220. { next.extra "b" =
  1221.     { "a" 'extra.label := }
  1222.     'skip$
  1223.   if$
  1224.   extra.label 'next.extra :=
  1225. }
  1226.  
  1227. EXECUTE {initialize.extra.label.stuff}
  1228.  
  1229. EXECUTE {init.prev.name}    %%%KCB:  needed for replacing repeated authors
  1230.  
  1231. ITERATE {forward.pass}
  1232.  
  1233. REVERSE {reverse.pass}
  1234.  
  1235. FUNCTION {bib.sort.order}
  1236. { sort.label
  1237.   "    "
  1238.   *
  1239.   year field.or.null sortify
  1240.   *
  1241.   "    "
  1242.   *
  1243.   title field.or.null
  1244.   sort.format.title
  1245.   *
  1246.   #1 entry.max$ substring$
  1247.   'sort.key$ :=
  1248.   calc.short.label
  1249. %%%KCB: removed   calc.long.label
  1250. }
  1251.  
  1252. ITERATE {bib.sort.order}
  1253.  
  1254. SORT
  1255.  
  1256. FUNCTION {begin.bib}
  1257. { preamble$ empty$
  1258.     'skip$
  1259.     { preamble$ write$ newline$ }
  1260.   if$
  1261. %%%KCB: add defn of \BySame, can be overridden in document
  1262. "\ifx\undefined\BySame" write$ newline$
  1263.   "\newcommand{\BySame}{\leavevmode\rule[.5ex]{3em}{.5pt}\ }"
  1264.        write$ newline$
  1265.   "\fi" write$ newline$
  1266. %%% KCB: For those who still cling to LaTeX 2.09
  1267. "\ifx\undefined\textsc" write$ newline$
  1268.   "\newcommand{\textsc}[1]{{\sc #1}}"
  1269.        write$ newline$
  1270.   "\newcommand{\emph}[1]{{\em #1\/}}"
  1271.        write$ newline$
  1272. "\let\tmpsmall\small" write$ newline$
  1273. "\renewcommand{\small}{\tmpsmall\sc}" write$ newline$
  1274.   "\fi" write$ newline$
  1275. %%%
  1276.   "\begin{thebibliography}{}" write$ newline$
  1277. }
  1278.  
  1279. EXECUTE {begin.bib}
  1280.  
  1281. EXECUTE {init.state.consts}
  1282.  
  1283. ITERATE {call.type$}
  1284.  
  1285. FUNCTION {end.bib}
  1286. { newline$
  1287.   "\end{thebibliography}" write$ newline$
  1288. "Done." top$    %%%KCB: Signal end for NeXTeX's TexView
  1289. }
  1290.  
  1291. EXECUTE {end.bib}
  1292. %% End of customized bst file
  1293.